package com.xxx.controller;

import com.xxx.pojo.Account;
import com.xxx.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/8/24 14:47
 * @Copyright 博为峰
 */
@Controller
public class ThymeleafController {

    @RequestMapping("/testVar")
    public String testVar(Model model, ModelMap map) {
        final Account account = new Account("G001", 10000);
        final User user = new User(1, "李四", 30, account);
        map.put("user", user);
        map.put("name", "张三");
        return "th-expression";
    }

    @RequestMapping("/testLink")
    public String testLink(Model model, ModelMap map) {
        map.put("orderId", "100");
        map.put("orderName", "phone");
        return "th-link";
    }
}
